import { routerMiddleware } from "connected-react-router";
import { createHashHistory } from "history";
import { applyMiddleware, createStore } from "redux";
import createRootReducer from "./reducers";
import createSagaMiddleware from 'redux-saga'
import rootSaga1 from './sagas/index'
import {composeWithDevTools} from 'redux-devtools-extension'

export const history = createHashHistory()

export const sagaMiddleware = createSagaMiddleware()

const store = createStore(
  createRootReducer(history),
  composeWithDevTools(
  applyMiddleware(routerMiddleware(history), sagaMiddleware))
)

sagaMiddleware.run(rootSaga1)

export default store